package com.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.dao.ProductDao;
import com.entity.Product;
@Service
public class ProductService {
	@Resource
	private ProductDao pd;
	public List<Product> allProduct(){
		return pd.allProduct();
	}
	public List<Product> getPage(int page){
		if(page<1){
			page=1;
		}
		return pd.getPage(page);
	}
	public int getcount(){
		int count=pd.getCount();
		int sum=count/4;
		if(count%4!=0){
			sum=count/4+1;
		}
		System.out.println(sum);
		return sum;
	}
}
